#pragma once
#include "Main.h"
#include <queue>
#include <boost/thread/mutex.hpp>

#include "IRequest.h"

using namespace std;

class RequestDispatcher
{
public:
	RequestDispatcher(void);
	~RequestDispatcher(void);

	void PushRequest(IRequest *aRequest);

	void Tick();
	void TickNoThread();

	void RunRequests();
	void EmptyRequests();

	void Stop();

	boost::mutex mMutex;
	boost::thread mWorkerThread;
	void operator()(void);

private:
	vector<IRequest*> mRequests;
};

